package com.favccxx.ticketrule.application;

import com.favccxx.ticketrule.domain.ticket.entity.OutDoorTicket;
import com.favccxx.ticketrule.domain.ticket.entity.Tourist;
import com.favccxx.ticketrule.domain.ticket.service.TouristService;
import com.favccxx.ticketrule.infrastructure.constants.TicketDiscount;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TicketService {

    @Autowired
    TouristService touristService;

    public double costPrice(OutDoorTicket ticket, Tourist tourist) {
        TicketDiscount ticketDiscount = touristService.getDiscount(tourist);
        Double discount = ticketDiscount.getDiscount();
        Double price = ticket.getPrice() * discount;
        return price;
    }

}
